package com.yizhu.zczy.user.controller;

import java.util.Arrays;
import java.util.Map;


import com.yizhu.zczy.common.utils.PageUtils;
import com.yizhu.zczy.common.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.yizhu.zczy.user.entity.ScorelogEntity;
import com.yizhu.zczy.user.service.ScorelogService;




/**
 * 会员积分变更记录表（暂时不用）
 *
 * @author guoyz
 * @email guoyz@mail.com
 * @date 2021-06-24 18:36:29
 */
@RestController
@RequestMapping("user/scorelog")
public class ScorelogController {
    @Autowired
    private ScorelogService scorelogService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    //@RequiresPermissions("user:scorelog:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = scorelogService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    //@RequiresPermissions("user:scorelog:info")
    public R info(@PathVariable("id") Integer id){
		ScorelogEntity scorelog = scorelogService.getById(id);

        return R.ok().put("scorelog", scorelog);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    //@RequiresPermissions("user:scorelog:save")
    public R save(@RequestBody ScorelogEntity scorelog){
		scorelogService.save(scorelog);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    //@RequiresPermissions("user:scorelog:update")
    public R update(@RequestBody ScorelogEntity scorelog){
		scorelogService.updateById(scorelog);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    //@RequiresPermissions("user:scorelog:delete")
    public R delete(@RequestBody Integer[] ids){
		scorelogService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
